import request from '@/utils/request'

export interface PostResponse {
  name: number
  age: number
  address: string
}

export function getList() {
  return request<{ array: PostResponse[] }>({
    url: '/api/user/get',
    method: 'get',
  })
}

export function pageList(params: any) {
  return request<{ array: PostResponse[]; param: any }>({
    url: '/api/user/page',
    method: 'get',
    params,
  })
}

/**
 * 获取用户身份
 * @param params
 * @returns
 */
export function getUserInfo() {
  return request<{
    [key: string]: any
  }>({
    url: '/api/user/info',
    method: 'get',
  })
}

export function getRouters() {
  return request<{
    [key: string]: any
  }>({
    url: '/api/user/getRouters',
    method: 'get',
  })
}
